<!--#include virtual="/dzps/p1.asp"-->
<!DOCTYPE html>
<html>
<head>
<%
	s11 "select cjcs from prj_table where [ID]={id}","cjcs"
	easp.include "h.asp"
	if val("cs")="" then
		vas "cs","1"
	end if	
%>
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
</head>
<body>
<input type="hidden" name="sszid" value="<%=val("ssbh")%>"> 
<input type="hidden" name="tn" value="<%=val("tn")%>"> 
<input type="hidden" name="dbName" value="<%=val("prn")%>"> 
<input type="hidden" name="wlbm" value="<%=val("wlbm")%>"> 
<input type="hidden" name="prj_id" value="<%=val("prj_id")%>"> 
<input type="hidden" name="cs" value="<%=val("cs")%>"> 

  <div class="layui-fluid">
    <div class="layui-card">
       <div class="layui-form" wid100 lay-filter="">	  
			 	<div class="layui-form-item">
								<button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="t_ret">
			 <i class="layui-icon layui-icon-return layuiadmin-button-btn"></i>
			 </button>	  <button class="layui-btn" lay-submit lay-filter="set_website">确认保存</button>

				</div>
<div class="layui-tab-content">
	<div class="layui-tab" lay-filter="test1">
		  <ul class="layui-tab-title">
			<li class="layui-this" lay-id="1" >1</li>
<%show_cs%>
		  </ul>

<%
	dim rs,arr
	if val("cjcs")<>"" then
		echo "共" & val("cjcs") & "次" & "<br>"
	end if
	
	function show_cs()
		dim i
		for i=2 to cint(val("cjcs"))
			echo "<li lay-id='"&cstr(i)&"'>"&cstr(i)&"</li>"
		next
	end function
	
	if val("ssbh")<>"" then
		echo "当前受试者编号：" & val("ssbh") & "<br>"
	end if

	echo "第" & val("cs") & "次" & "<br>"

	set rs = Easp.Db.Sel("select fld,colName,mm1,regu1,tn from ti0 where tn={tn} and dbName={prn} order by id")
	if rs.recordCount >=1 then
		arr = rs.GetRows
		t_show
	else
		echo "表内容为空"
	end if

	function t_show()
		dim maxrow,i,j,txt,mb,cont,required
		maxrow=ubound(arr,2)
		s11 "select name2 as xxts from [baseinfo] where [name1]='选项提示'","xxts"	

		s11_2 "select * from " & val("wlbm") & " where ssbh={ssbh} and cs={cs}"	
		for i=0 to maxrow
			required=""
			if (instr(arr(2,i),"(") >0) and (instr(arr(2,i),"，") >0) then
				Echo mymm2 (arr(0,i),arr(1,i),arr(2,i),val(hr_bd(arr(0,i))))
				' echo val(hr_bd(arr(0,i)))
				echo "<br>"
				if val("xxts")="1" then
					Echo arr(2,i)
				end if
			elseif (instr(arr(0,i),"blank" )=0 ) then
				if (arr(0,i) = "SSBH" or arr(0,i) = "NAME") then
					mb="input1_r.html"
					cont=val(arr(0,i))
					if val("ssbh")="" then
						mb="input1.html"
						required="required"
					end if
				elseif arr(3,i)="yyyy/mm/dd" then
					mb="input1_p.html"
					cont=val(hr_bd(arr(0,i)))
				else
					mb="input1.html"
					cont=val(hr_bd(arr(0,i)))
				end if
				txt=replace(js2(mb,arr(0,i),arr(1,i),cont,required),"layui-input-inline","layui-input-block") 'required'
				txt=replace(txt,"[dy:placeholder]",arr(3,i))
				Echo txt
			elseif (instr(arr(0,i),"blank" )<>0 or trim(arr(0,i))="" ) then
				echo arr(2,i)&"<br>"
			end if
		next
	end function
%>
	<div class="layui-form-item">
	<div class="layui-input-block">
					<button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="t_ret">
			 <i class="layui-icon layui-icon-return layuiadmin-button-btn"></i>
			 </button>
	  <button class="layui-btn" lay-submit lay-filter="set_website">确认保存</button>
	</div>
	</div>
	</div>
	</div>

</div>
    </div>
  </div>
  <script src="../../../layuiadmin/layui/layui.js"></script> 
  <script>
  layui.config({
    base: '../../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set','element','form'],function(){
    var $ = layui.$
    ,admin = layui.admin
    ,form = layui.form;  

function GetQueryString(name)
{
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
};
	
 var element = layui.element;
  var layid = location.hash.replace(/^#test1=/, '');
  element.tabChange('test1', <%=val("cs")%>); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项
  //监听Tab切换，以改变地址hash值
  element.on('tab(test1)', function(){
	var loc=window.location.href;
	if (GetQueryString("cs") !=null) {
		loc=loc.replace('&cs='+GetQueryString("cs"),'');
	}	
	location.href = loc+'&cs='+this.getAttribute('lay-id');
  });	
  		var tn=$("input[name='tn']").val();
  		var dbName=$("input[name='dbName']").val();
  		var sszid=$("input[name='sszid']").val();
  		var wlbm=$("input[name='wlbm']").val();
  		var prj_id=$("input[name='prj_id']").val();
  		var cs=$("input[name='cs']").val();

      form.on('submit(set_website)', function(data){
      var field = data.field;
      admin.req({
        url: layui.setter.base + 'lib/reg.asp?action=website1' 
        ,type:"post"
		,data: {field,prn:dbName,tn:tn,sszid:sszid,wlbm:wlbm,prj_id:prj_id,cs:cs}
        ,done: function(res){
			if(res.code="0"){
				layer.msg(res.msg, {icon: 6,time:2000}); 
			}
        }
      });      
    });

  	form.on('submit(t_ret)',function(data){
		location.href = "javascript:history.back();" 
	});
  });
  </script>
</body>
</html>